import svgIcon from "@/components/svgIcon/index.vue";
import { install } from "element-plus";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";

const allGloablComponents = { svgIcon };

export default {
  install(app) {
    // 注册全局组件方法
    Object.keys(allGloablComponents).forEach((key) => {
      app.component(key, allGloablComponents[key]);
    });
    //将element-plus提供图标注册为全局组件
    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
      app.component(key, component);
    }
  },
};
